/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Observer4;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Marcel
 */
public abstract class Subject {
    
    List<Observer> list = new ArrayList<Observer>();
    
    public void add(Observer o) {
        list.add(o);
    }
    
    public void remove(Observer o) {
        list.remove(o);
    }
    
    public void notifica () {
        for (Observer o : list) {
            o.update();
        }
    }

    public abstract void setState(String a);
    
}
